﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var recommanage_type_add_mid = "_{recommanage_type_add_mid}";
	var recommanage_js_noselect_empty = "_{recommanage_js_noselect_empty}";
	var recommanage_js_labelname_empty = "_{recommanage_js_labelname_empty}";
	var recommanage_js_type_add_ok = "_{recommanage_js_type_add_ok}";
	var recommanage_js_type_add_no = "_{recommanage_js_type_add_no}";
	var iframename = "#{iframename}";
	iframename = iframename=='' ? "jerichotabiframe_0" : iframename;
	$(document).ready(function(){
	    var h = '#{iframeheightwindow}';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: true
		}
		$('#recomadd').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
		parent.scrolclear();
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['mid']==0){
			document.recomadd.mid.focus();
			alert(recommanage_type_add_mid+recommanage_js_noselect_empty);
			return false;
		}
		if(get['labelname']==''){
			document.recomadd.labelname.focus();
			alert(recommanage_js_labelname_empty);
			return false;
		}
		parent.windowsdig('Loading', 'iframe:#{load}', '400px', '180px', 'iframe', false);
	}
	function saveResponse(options){
		parent.closeifram();
		var tab=document.getElementById("recomaddtab").value;
		if (options=='true'){
			if (tab=='true'){
				if(parent.frames[iframename].document.getElementById("selectform")){
					parent.frames[iframename].refresh('selectform','selectall','check_all');
				}
			}
			alert(recommanage_js_type_add_ok);
		}else{
			alert(recommanage_js_type_add_no+options);
		}

		var refalse = "#{refalse}";
		if (refalse!='1'){
			if (tab=='true'){
				parent.scrolopen();
				parent.onaletdoc()
			}
		}else{
			window.location.reload();
		}
	}
</script>
</head>

<body>
<form name="recomadd" id="recomadd" method="post" action="#{ActionLink}">
<input type="hidden" name="inputclass" value="add" />
<input type="hidden" name="lng" id="lng" value="#{lng}" />
<input type="hidden" name="tab" id="recomaddtab" value="#{tab}" />
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<!--查看已选择的类型-->
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">_{position_title}</span><span class="colorgorningage">_{recommanage_type_add_mess}</span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td width="15%" class="trtitle011">_{recommanage_type_add_mid}</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="mid" id="mid">
								<option value="0">_{recommanage_type_add_mid_option}</option>
                                <%var list = v.data("list") as List<Model>; %>
                                <%foreach(var row in list){ %>
								<option value="<%=row.Id %>"><%=row.modelname %></option>
								<%} %>
							</select>
							<span class="cautiontitle">_{recommanage_type_add_mid_mess}</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle011">_{recommanage_type_add_labelname}</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="labelname" size="40" maxlength="80" class="infoInput"/>
							<span class="cautiontitle">_{recommanage_type_add_labelname_mess}</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" name="Submit" value="_{botton_add}" class="buttonface" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:closewindow();" value="_{botton_add_reset}" class="buttonface" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>